package com.huihui.activity.setting;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.huihui.R;
import com.huihui.base.BaseActivity;
import com.huihui.eventbus.SettinNickNameEvent;

import org.greenrobot.eventbus.EventBus;

/**
 * 密码修改
 */
public class SettingNickActivity extends BaseActivity {

    private EditText input_new_nickname;
    private TextView confirm;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting_nick_name);
//        getSupportActionBar().setTitle(R.string.setting_nickname);
        titleView.setText(R.string.setting_nickname);
        initView();
        initListener();
    }

    private void initView() {
        input_new_nickname = (EditText) findViewById(R.id.input_new_nickname);
        confirm = (TextView) findViewById(R.id.confirm);
    }

    private void initListener() {
        confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EventBus.getDefault().post(new SettinNickNameEvent(input_new_nickname.getText().toString()));
                finish();
            }
        });
    }
}
